package com.meiqiongproperty.yiguanjia.db.table;

/**
 * 用戶表
 * @version V1.0
 * @packge com.meiqiongproperty.yiguanjia.db.table
 * @User ChenJing
 * @Date 2017/5/22
 */

public interface UserInfoTable {
    // 表名
    public static final String TABLE_NAME = "user_info";
    /**
     * Id : 12
     * LoginName :
     * Mobile : 13762093522
     * Relation : 0
     * CreateAt : 2017-05-16 21:53:53
     * RealName : GGG
     * Sex : 1
     * Birthday :
     * is_enable : 1
     * Remark :
     * Point : 0
     * Avatar :
     * Device : asdasdasd
     * Token : 0A227DB3AAEEA3D6CDDF554192A2C80A
     */
    public static final String ID="_Id";
    public static final String USERID="user_id";
    public static final String LOGINNAME="login_name";
    public static final String MOBILE="mobile";
    public static final String RELATION="relation";
    public static final String CREATEAT="createat";
    public static final String REALNAME="real_name";
    public static final String SEX="sex";
    public static final String BIRTHDAY="birthday";
    public static final String IS_ENABLE="is_enable";
    public static final String REMARK="remark";
    public static final String POINT="point";
    public static final String AVATAR="avatar";
    public static final String DEVICE="device";
    public static final String TOKEN="token";


    // 字段的索引号
    public static final int INDEX_ID = 0;
    public static final int INDEX_USERID=1;
    public static final int INDEX_LOGINNAME = 2;
    public static final int INDEX_MOBILE = 3;
    public static final int INDEX_RELATION = 4;
    public static final int INDEX_CREATEAT = 5;
    public static final int INDEX_REALNAME=6;
    public static final int INDEX_SEX=7;
    public static final int INDEX_BIRTHDAY=8;
    public static final int INDEX_IS_ENABLE=9;
    public static final int INDEX_REMARK=10;
    public static final int INDEX_POINT=11;
    public static final int INDEX_AVATAR=12;
    public static final int INDEX_DEVICE=13;
    public static final int INDEX_TOKEN=14;

    /**
     * SQL,删除表
     */
    public static final String SQL_TABLE_DROP = String.format(
            "DROP TABLE IF EXISTS %s;", TABLE_NAME);
    /**
     * SQL,创建表
     */
    public static final String SQL_TABLE_CREATE = new StringBuilder()
            .append("CREATE TABLE IF NOT EXISTS ").append(TABLE_NAME)
            .append("(").append(ID).append(" INTEGER PRIMARY KEY,")
            .append(USERID).append(" TEXT,")
            .append(LOGINNAME).append(" TEXT,")
            .append(MOBILE).append(" TEXT,")
            .append(RELATION).append(" TEXT,")
            .append(CREATEAT).append(" TEXT,")
            .append(REALNAME).append(" TEXT,")
            .append(SEX).append(" TEXT,")
            .append(BIRTHDAY).append(" TEXT,")
            .append(IS_ENABLE).append(" TEXT,")
            .append(REMARK).append(" TEXT,")
            .append(POINT).append(" TEXT,")
            .append(AVATAR).append(" TEXT,")
            .append(DEVICE).append(" TEXT,")
            .append(TOKEN).append(" TEXT").append(");").toString();
}
